<include file="Public/common" />
<block>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        .col-xs-3{margin-top:5px;}
        th{text-align: center;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 &gt;产品管理  >  团号管理</h1></div>
    <div class="container-fluid">
        <div class="tabbable">
            <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab">
                <li <if condition="$post['source_type'] eq 1">class="active"</if> ><a href="{:U('groupManage',array('source_type'=>'1'))}">自营</a></li>
                <li <if condition="$post['source_type'] eq 2">class="active"</if>><a href="{:U('groupManage',array('source_type'=>'2'))}">供应商</a></li>
            </ul>
            <div class="tab-content">
                <div class="row" >
                    <form action="" class="form-inline " method="get" style="margin-left:10px;" >
                        <input type="hidden" name="status" value="{$post.status}" style="display: none;">
                        <input type="hidden" name="source_type" value="{$post.source_type}" style="display: none;">
                        <div class="form-group">
                            <label for="line_name">线路名称</label>
                            <input type="text" class="" name="line_name" id="line_name" placeholder="线路名称" value="{$post.line_name}">
                        </div>
                        <div class="form-group">
                            <label for="lineName">成团状态</label>
                            <select name="group_status" id="group_status">
                                <option  value="">全部</option>
                                <option <if condition="$post['group_status'] eq 1 ">selected</if>  value="0">待处理</option>
                                <option <if condition="$post['group_status'] eq 1 ">selected</if>  value="1">已成团</option>
                                <option  <if condition="$post['group_status'] eq 2 ">selected</if> value="2">已出团</option>
                                <option <if condition="$post['group_status'] eq 3 ">selected</if>  value="3">已回团</option>
                                <option <if condition="$post['group_status'] eq -1 ">selected</if>  value="-1">不成团</option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label for="lineName">团号</label>
                            <input type="text" class="" name="group_num" id="group_num" placeholder="团号" value="{$post.group_num}">
                        </div>

                        <div class="form-group">
                            <label for="pushDepartment">出团日期</label>
                            <input type="text" class="" name="out_time" id="out_time" placeholder="出团日期" value="{$post.out_time}" readonly>
                            <span class="input-group-addon" style="display:inline">至</span>
                            <input type="text" class="" name="out_time_end" id="out_time_end" placeholder="出团日期" value="{$post.out_time_end}" readonly>
                        </div>

                        <!--<div class="form-group">
                            <label for="closing_status">结算状态</label>
                            <select name="closing_status" id="closing_status">
                                <option  value="">全部</option>
                                <option <if condition="$post['closing_status'] eq -1 ">selected</if> value="-1">待结算</option>
                                <option <if condition="$post['closing_status'] eq 1 ">selected</if> value="1">结算中</option>
                                <option <if condition="$post['closing_status'] eq 2 ">selected</if> value="2">已结算</option>
                            </select>
                        </div>-->

                        <button type="submit" class="btn btn-primary btn-sm">查询</button>
                    </form>
                </div>

                <div class="col-xs-12"  style="margin-top:10px;">
                    <button class="btn btn-primary btn-xs pull-right" type="button" id="dropdownMenu1" data-toggle="dropdown">
                        筛选
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1" style="padding:10px;">
                        <li><input type="checkbox" class="filtrate" checked value="1" id="filtrate_1"> <label for="filtrate_1">团号</label> </li>
                        <li><input type="checkbox" class="filtrate"checked value="2" id="filtrate_2"><label for="filtrate_2">产品名称</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="3" id="filtrate_3"><label for="filtrate_3">成团时间</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="4" id="filtrate_4"><label for="filtrate_4">出团日期</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="6" id="filtrate_6"><label for="filtrate_6">出发地点</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="7" id="filtrate_7"><label for="filtrate_7">天数</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="8" id="filtrate_8"><label for="filtrate_8">已收客人数</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="9" id="filtrate_9"><label for="filtrate_9">预计收客</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="10" id="filtrate_10"><label for="filtrate_10">操作人</label></li>
                        <li><input type="checkbox" class="filtrate"checked value="11" id="filtrate_11"><label for="filtrate_11">状态</label></li>
                    </ul>
                    <if condition="checkAuth('Operator/Product/exportExcelGroupList')">
                        <a href="{:U('exportExcelGroupList')}" class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">导出</a>
                    </if>
                </div>
                <table class="table table-striped table-bordered table-hover table-condensed text-center">
                    <thead>
                    <tr>
                        <th class="filtrate_1" >团号 <!--<input type="checkbox" class="checkAll">--></th>
                        <th class="filtrate_2" >产品名称</th>
                        <th class="filtrate_3" >成团时间</th>
                        <th class="filtrate_4" >出团日期</th>
                        <th class="filtrate_6" >出发地点</th>
                        <th class="filtrate_7" >天数</th>
                        <th class="filtrate_8">已收客人数</th>
                        <th class="filtrate_9" >预计收客</th>
                        <th class="filtrate_10" >操作人</th>
                        <th class="filtrate_11" >状态</th>
                        <th class="filtrate_11" >操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="list" id="vo">
                        <tr >
                            <td class="filtrate_1" >{$vo.group_num} <!--<input type="checkbox" class="chk">--></td>
                            <td class="filtrate_2">{$vo.line_name}</td>
                            <td class="filtrate_3">
                                <if condition="$vo['group_time']"> {$vo.group_time|date="Y-m-d",###}</if>
                               </td>
                            <td class="filtrate_4">{$vo.out_time|date="Y-m-d",###}</td>
                            <td class="filtrate_6">{$vo.areaName}</td>
                            <td class="filtrate_7">{$vo.day_num}</td>
                            <td class="filtrate_8">{$vo.received_num}</td>
                            <td class="filtrate_9">{$vo.expect_num}</td>
                            <td class="filtrate_10">{$vo.operator_name}</td>
                            <td class="filtrate_11">
                                <switch name="vo.group_status">
                                    <case value="1">待处理</case>
                                    <case value="1">已成团</case>
                                    <case value="2">已出团</case>
                                    <case value="3">已回团</case>
                                    <case value="-1">不成团</case>
                                </switch>
                            </td>
                            <td class="filtrate_13">

                                <switch name="vo.group_status">
                                    <case value="0">
                                        <a href="{:U('changeGroupStatus',array('id'=>$vo['group_id'],'status'=>-1))}" class="btn btn-danger btn-xs">不成团</a>
                                        <a href="{:U('changeGroupStatus',array('id'=>$vo['group_id'],'status'=>1))}" class="btn btn-primary btn-xs">成团</a>
                                    </case>
                                    <case value="1"><a href="{:U('changeGroupStatus',array('id'=>$vo['group_id'],'status'=>2))}" class="btn btn-primary btn-xs">已出团</a></case>
                                    <case value="2"><a href="{:U('changeGroupStatus',array('id'=>$vo['group_id'],'status'=>3))}" class="btn btn-primary btn-xs">已回团</a></case>
                                </switch>
                                <if condition="checkAuth('Operator/Product/groupDetail')">
                                    <a href="{:U('groupDetail',array('id'=>$vo['group_id']))}" class="btn btn-primary btn-xs">详情</a>
                                </if>
                            </td>
                        </tr>
                    </volist>
                    <tr>
                        <td colspan="14">
                            <!--分页样式-->
                            <ul class="pagination">
                                {$show}
                            </ul>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</block>
<block name="js">
<script src=""></script>
<script src="__STATIC__/layui/layui.all.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script>
/**
 * 打开订单详情页面
 * @param  {[int]}    orderId     [订单id]
 */

//筛选显示
$('body').on('change','.filtrate',function () {
   var id=$(this).val();
   if($(this).is(':checked')){
        $('.filtrate_'+id).show();
   }else{
       $('.filtrate_'+id).hide();
   }
});


layui.use('laydate', function() {
    var laydate = layui.laydate;
    //常规用法
    laydate.render({
        elem: '#out_time'
    });
    laydate.render({
        elem: '#out_time_end'
    });
})

/**
 *订单详情
 * @param orderId
 */

function openDetail(orderId){
    layer.open({
        type: 2,
        offset:20,
        area: ['90%','90%'],
        title: '订单详情',
        content: '{:U("Orders/detail")}',
    })
}
</script>
</block>
